package cn.tedu.util;

import java.util.Random;

//测试 模拟多线程编程
public class Test5 {
    public static void main(String[] args) {
            MyRunnable target=new MyRunnable();
            Thread t=new Thread(target);
            t.start();
            Thread t2=new Thread(target);
            t2.start();
    }
}
//创建线程类 --实现Runnable接口
class MyRunnable implements Runnable{
    @Override
    public void run() {
        //需求：打印10次线程名称
        for (int i = 0; i < 10; i++) {
            System.out.println(Thread.currentThread().getName()+"*******"+i);
        }
    }
}



